package org.jeecg.modules.xl.cityconfig.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.xl.cityconfig.entity.XlConfigCityDelivery;
import org.jeecg.modules.xl.cityconfig.mapper.XlConfigCityDeliveryMapper;
import org.jeecg.modules.xl.cityconfig.service.IXlConfigCityDeliveryService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.Map;
import java.util.stream.Collectors;

/**
 * @Description: xl_config_city_delivery
 * &#064;Author:  jeecg-boot
 * @Date:   2024-11-02
 * @Version: V1.0
 */
@Service
public class XlConfigCityDeliveryServiceImpl extends ServiceImpl<XlConfigCityDeliveryMapper, XlConfigCityDelivery> implements IXlConfigCityDeliveryService {

    @Cacheable(cacheNames = "getXlConfigCityDeliveryMapList#3600")
    @Override
    public Map<String, XlConfigCityDelivery> getXlConfigCityDeliveryMapList() {
        return baseMapper.selectList(null).stream().collect(Collectors.toMap(XlConfigCityDelivery :: getCity , item -> item ));

    }
}
